<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/common/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<style type="text/css">


	</style>
<link href="${ctx}resources/css/select/bootstrap-select.css" rel="stylesheet" type="text/css">
<%@ include file="/WEB-INF/common/head.jsp"%>
</head>
<body class="${cookie.bodyClass.value}">
	<div class="container body">
		<div class="main_container">
			<%@ include file="/WEB-INF/common/left.jsp"%>
			<%@ include file="/WEB-INF/common/top.jsp"%>
			<!-- page content -->
			<div class="right_col" role="main" id="main">
				<div class="x_panel">
					<div class="x_title">
						<h2>系统设置</h2>
						<div class="clearfix"></div>
					</div>
					<div class="x_content">
						<div class="modal-body">
							<form role="form" data-parsley-validate id="systemSettingForm" class="form-horizontal">
								<input id="systemSettingId" name="systemSettingId" type="hidden" value="${systemSetting.systemSettingId}" />
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">上传文件大小（M）:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="uploadSize" name="uploadSize" value="${systemSetting.uploadSize}" 
											placeholder="上传文件大小，数字整形" required='required' data-parsley-length="[0,5]" data-parsley-type="integer">
									</div>
								</div>
								<%-- <div class="form-group item">
									<label for="name" class="col-sm-3 control-label">成为商家会员（元）:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="businessMemberMoney" name="businessMemberMoney" value="${systemSetting.businessMemberMoney}" placeholder="最少提现金额，浮点型" required='required'
											data-parsley-length="[0,10]" data-parsley-pattern="[-\+]?\d+(\.\d+)?">
									</div>
								</div> --%>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">最少提现金额（元）:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="minWithdrawalsMoney" name="minWithdrawalsMoney" value="${systemSetting.minWithdrawalsMoney}" placeholder="最少提现金额，浮点型" required='required'
											data-parsley-length="[0,10]" data-parsley-pattern="[-\+]?\d+(\.\d+)?">
									</div>
								</div>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">用户返利比例（%）:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="memberRebateRate" name="memberRebateRate" value="${systemSetting.memberRebateRate}" placeholder="用户返利比例，浮点型" required='required'
											data-parsley-length="[0,10]" data-parsley-pattern="[-\+]?\d+(\.\d+)?">
									</div>
								</div>
							<%-- 	<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">商家返利比例（%）:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="businessRebateRate" name="businessRebateRate" value="${systemSetting.businessRebateRate}" placeholder="商家返利比例，浮点型" required='required'
											data-parsley-length="[0,10]" data-parsley-pattern="[-\+]?\d+(\.\d+)?">
									</div>
								</div> --%>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">金积分返利比例（%）:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="goldPointsRebateRate" name="goldPointsRebateRate" value="${systemSetting.goldPointsRebateRate}" placeholder="金积分返利比例，浮点型" required='required'
											data-parsley-length="[0,10]" data-parsley-pattern="[-\+]?\d+(\.\d+)?">
									</div>
								</div>
								<%-- <div class="form-group item">
									<label for="name" class="col-sm-3 control-label">银积分返利比例（%）:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="silverPointsRebateRate" name="silverPointsRebateRate" value="${systemSetting.silverPointsRebateRate}" placeholder="银积分返利比例，浮点型" required='required'
											data-parsley-length="[0,10]" data-parsley-pattern="[-\+]?\d+(\.\d+)?">
									</div>
								</div> --%>
								<%-- <div class="form-group item">
									<label for="name" class="col-sm-3 control-label">普通会员返现比例（%）:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="ordinaryRebateRate" name="ordinaryRebateRate" value="${systemSetting.ordinaryRebateRate}" placeholder="普通会员返现比例，浮点型" required='required'
											data-parsley-length="[0,10]" data-parsley-pattern="[-\+]?\d+(\.\d+)?">
									</div>
								</div> --%>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">经销商返现比例（%）:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="franchiserRebateRate" name="franchiserRebateRate" value="${systemSetting.franchiserRebateRate}" placeholder="经销商返现比例，浮点型" required='required'
											data-parsley-length="[0,10]" data-parsley-pattern="[-\+]?\d+(\.\d+)?">
									</div>
								</div>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">分销商返现比例（%）:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="distributorRebateRate" name="distributorRebateRate" value="${systemSetting.distributorRebateRate}" placeholder="分销商返现比例，浮点型" required='required'
											data-parsley-length="[0,10]" data-parsley-pattern="[-\+]?\d+(\.\d+)?">
									</div>
								</div>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">代理商返现比例（%）:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="agentRebateRate" name="agentRebateRate" value="${systemSetting.agentRebateRate}" placeholder="代理商返现比例，浮点型" required='required'
											data-parsley-length="[0,10]" data-parsley-pattern="[-\+]?\d+(\.\d+)?">
									</div>
								</div>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">商品专区返现比例（%）:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="prefectureRebateRate" name="prefectureRebateRate" value="${systemSetting.prefectureRebateRate}" placeholder="商品专区返现比例，浮点型" required='required'
											data-parsley-length="[0,10]" data-parsley-pattern="[-\+]?\d+(\.\d+)?">
									</div>
								</div>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">提现手续费（0-1999）（元）:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="withdrawalsBrokerage1" name="withdrawalsBrokerage1" value="${systemSetting.withdrawalsBrokerage1}" placeholder="提现手续费，浮点型" required='required'
											   data-parsley-length="[0,10]" data-parsley-pattern="[-\+]?\d+(\.\d+)?">
									</div>
								</div>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">提现手续费（2000-19999）（元）:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="withdrawalsBrokerage2" name="withdrawalsBrokerage2" value="${systemSetting.withdrawalsBrokerage2}" placeholder="提现手续费，浮点型" required='required'
											data-parsley-length="[0,10]" data-parsley-pattern="[-\+]?\d+(\.\d+)?">
									</div>
								</div>
								<div class="form-group item">
									<label for="name" class="col-sm-3 control-label">提现手续费（20000以上）（元）:<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="withdrawalsBrokerage3" name="withdrawalsBrokerage3" value="${systemSetting.withdrawalsBrokerage3}" placeholder="提现手续费，浮点型" required='required'
											data-parsley-length="[0,10]" data-parsley-pattern="[-\+]?\d+(\.\d+)?">
									</div>
								</div>
							</form>
						</div>
						<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12" style="text-align:center">
							<button type="button" class="btn btn-primary btn-sm" onclick="save();">保存</button>
						</div>
					</div>
				</div>
			</div>
			<!-- /page content -->
			<%@ include file="/WEB-INF/common/foot.jsp"%>
		</div>
	</div>
	<%@ include file="/WEB-INF/common/script.jsp"%>
	<script src="${ctx}resources/js/select/bootstrap-select.js"></script>
	<script type="text/javascript">
	$(function() {
	});
		function save() {
			if (!$('#systemSettingForm').parsley().validate()) {
				swal({
					title : '',
					text : "请完善信息",
					type : "info"
				});
				return;
			}
			swal({
				"title" : "",
				"text" : "正在处理……请稍后",
				"showConfirmButton" : false
			});
			$.ajax({
				url : ctx + "admin/systemSetting/saveSystemSetting",
				dataType : "json",
				data : $("#systemSettingForm").serialize(),
				success : function(result) {
					if (result.status == "0") {
						swal({
							title : '',
							text : "保存成功"
						}, function() {
                            window.location = ctx+'admin/systemSetting/toSystemSettingDetailPage';
						});
					} else {
						swal({
							title : '',
							text : result.msg,
							type : "error"
						});
					}
				}
			});
		}
	</script>
</body>
</html>